/**
 * Copyright(c) ${copyrightYear} ${company}
 * All rights reserved.
 * Created on ${date}
 */
package ${package};

import ${package}.util.LogUtil;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
/**
 * 异常捕获拦截器
 * 
 * @author ${author}
 * 
 */
public  class ExceptionInterceptor extends AbstractInterceptor {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    /**
     * 拦截器的拦截方法
     * 
     * @throws Exception
     *             抛出所有异常
     */
    @Override
    public String intercept(ActionInvocation invocation) throws Exception {
        try {
            String result = invocation.invoke();
            return result;
        } catch (Exception e) {
            LogUtil.error(e);
            return "error";
        }
    }

}
